package main

import (
	"github.com/julienschmidt/httprouter"
	"net/http"
	"video_server/scheduler/dbops"
)

// 视频删除实际上是把要删除的视频id存入 video_del_rec 表中，然后让定时任务在去删除视频
// videoDeleteRecord 视频删除
func videoDeleteRecord(w http.ResponseWriter, r *http.Request, p httprouter.Params) {
	vid := p.ByName("vid-id")
	if len(vid) == 0 {
		sendResponse(w, 400, "视频id 未传输")
		return
	}

	err := dbops.AddVideoDeletionRecord(vid)
	if err != nil {
		sendResponse(w, 500, "服务器异常")
		return
	}

	sendResponse(w, 200, "")
	return
}
